<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <!-- <link rel="stylesheet" href="./normalize.css"> -->
    <!-- <link rel="stylesheet" href="./modern reset.css"> -->
    <!-- <link rel="stylesheet" href="./normalize.css"> -->
    <style>
      html {
        font-size: 20px;
        h1 {
          font-size: 5rem;
        }
      }
    </style>
  </head>
  <body>
    <h1 style="color: pink">JAY</h1>
  </body>
  <script>
    window.onload = function () {
      window.addEventListener("resize", function () {
        var width = document.body.clientWidth;
        document.querySelector("html").style.fontSize = width / 10 + "px";
        // 监听浏览器的宽度
      });
    };
  </script>
</html>
